<?php



/**
 * Skeleton subclass for performing query and update operations on the 'user_positions' table.
 *
 *
 *
 * You should add additional methods to this class to meet the
 * application requirements.  This class will only be generated as
 * long as it does not already exist in the output directory.
 *
 * @package    propel.generator.empeval
 */
class EmpevalUserPositionsQuery extends EmpevalBaseUserPositionsQuery
{
	
	public function addSuperiorUserPositionFilters($superiorUnitId, $childUnits) {
		$this
		->condition('cond1', EmpevalUserPositionsPeer::UNIT_ID . ' = ' . $superiorUnitId)
		->condition('cond2', EmpevalUserPositionsPeer::IS_SUPERIOR . ' = 0')
		->combine(array('cond1', 'cond2'), Criteria::LOGICAL_AND, 'cond12')
		->condition('cond3', EmpevalUserPositionsPeer::UNIT_ID . ' IN ?', $childUnits)
		->condition('cond4', EmpevalUserPositionsPeer::IS_SUPERIOR . ' = 1')
		->combine(array('cond3', 'cond4'), Criteria::LOGICAL_AND, 'cond34')
		->condition('cond5', EmpevalUserPositionsPeer::ACTIVE . ' = 1')
		->combine(array('cond12', 'cond34'), Criteria::LOGICAL_OR, 'cond1234')
		->where(array('cond1234', 'cond5'), Criteria::LOGICAL_AND);
		return $this;
	}
	
}
